package com.yun.zf.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.dto.house.AdminHousePicDto;
import com.yun.zf.common.app.domain.ZfHousePicture;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 房源图片表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
@Mapper
public interface ZfHousePictureMapper extends BaseMapper<ZfHousePicture> {

    @Select("<script>" +
            " SELECT id,url,location,type from zf_house_picture WHERE type in (2,3)"+
            " and  basic_id =#{houseId} and city_code =#{cityCode} and province_code=#{provCode} " +
            "</script>")
    public List<AdminHousePicDto> getPics(Long houseId, Long provCode, Long cityCode);

    @Select("<script>" +
            " SELECT id,url,location,type from zf_house_picture WHERE type=#{type} and  basic_id =#{houseId} and city_code =#{cityCode} and province_code=#{provCode} " +
            "</script>")
    public List<AdminHousePicDto> getPics(Long houseId, Long provCode, Long cityCode, int type);
}
